package cn.stylefeng.guns.modular.business.frequency.pricelibrary.mapper;

import cn.stylefeng.guns.modular.business.frequency.pricelibrary.model.param.PriceLibraryDTO;
import cn.stylefeng.guns.modular.business.frequency.pricelibrary.model.result.PickTakePrice;
import cn.stylefeng.guns.modular.business.frequency.pricelibrary.model.result.PkgPriceLibrary;
import cn.stylefeng.guns.modular.business.frequency.pricelibrary.model.result.PkgPriceLibrarySearch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.stylefeng.guns.modular.business.frequency.pricelibrary.entity.PriceLibrary;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.math.BigDecimal;
import java.util.List;

/**
 * 价格库 Mapper 接口
 *
 * @author yujie
 * @date 2023/05/09 17:16
 */
public interface PriceLibraryMapper extends BaseMapper<PriceLibrary> {

    /**价格库分页列表*/
    Page<PkgPriceLibrary> getPriceLibraryListPage(@Param("page")Page<Object> defaultPage,@Param("priceLibraryDTO") PriceLibraryDTO priceLibraryDTO,@Param("tenantId") Long tenantId);

    int checkRepeat(@Param("id") Long id,
                    @Param("startCode") String startCode,
                    @Param("destinationCode") String destinationCode,
                    @Param("companyName") String companyName,
                    @Param("linkPhone") String linkPhone,
                    @Param("cost") BigDecimal cost);

    void updateStatusById(@Param("id") String id, @Param("status") Integer status, @Param("originStatus") Integer originStatus);

    List<PkgPriceLibrarySearch> getPriceLibrarySearchTwice(@Param("priceLibraryDTO") PriceLibraryDTO priceLibraryDTO);

    PkgPriceLibrary getPriceDetail(@Param("id") String id1);

    List<PkgPriceLibrarySearch> getPriceLibrarySearchThrIce(@Param("priceLibraryDTO")PriceLibraryDTO priceLibraryDTO);

    List<PriceLibrary> getExportDataList();

    int countPickTakePriceList(@Param("pickTakePriceDTO") PriceLibraryDTO pickTakePriceDTO);

    Page<PickTakePrice> getPickTakePriceListPage(@Param("page") Page<Object> defaultPage,@Param("pickTakePriceDTO") PriceLibraryDTO pickTakePriceDTO);

    PkgPriceLibrary getMinimumPrice(@Param("priceLibraryDTO") PriceLibraryDTO priceLibraryDTO,@Param("tenantId")Long tenantId);

    PkgPriceLibrary getDetailById(@Param("id") String id);
}